package com.woniu.supermarket.mapper;

import com.woniu.supermarket.entity.Sales;
import com.woniu.supermarket.vo.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
public interface SalesMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Sales record);

    Sales selectByPrimaryKey(Integer id);

    List<Sales> selectAll();

    int updateByPrimaryKey(Sales record);

    List<SalesVo> selectByCons(@Param(value = "code") String salesCode);

    void updatePriceByPrimaryKey(SalesVo sales);

    List<dealVo> selectDealByCons(@Param(value = "salecodeOrName")String salecodeOrName);

    List<dealVo> selectAdvancedDealByCons(  @Param(value = "dealStartTime") Date dealStartTime,
                                            @Param(value = "dealEndTime")Date dealEndTime,
                                            @Param(value = "memberTel")String memberTel,
                                            @Param(value = "salecodeOrName")String salecodeOrName,
                                            @Param(value = "shid")Integer shid,
                                            @Param(value = "staff")String staff,
                                            @Param(value = "typeOrder")Integer typeOrder);

    List<dealSummaryVo> selectDealSummaryByCons(@Param(value = "salecodeOrName") String salecodeOrName,
                                                @Param(value = "searchType") Integer searchType);
}